package com.pzhu.gmall.manage.controller;

import java.util.List;

import com.pzhu.gmall.bean.PmsProductInfo;
import com.pzhu.gmall.service.SpuService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 刘鹏 liupeng
 * @date 2019/10/31
 **/

@RestController
@RequestMapping("/spu")
@CrossOrigin
public class SpuController {
    @Reference
    private SpuService spuService;



    @GetMapping
    public List<PmsProductInfo> SpuList(String catalog3Id) {
        return spuService.getSpuListBycatalog3Id(catalog3Id);
    }

    @PostMapping
    public PmsProductInfo addSpu(@RequestBody PmsProductInfo pmsProductInfo) {
        spuService.save(pmsProductInfo);
        return pmsProductInfo;
    }


}
